home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7501 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: stern.fokus.gmd.de!news
  2. From: Watson <sayegh@fokus.gmd.de>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Need some simple help with C++
  5. Date: Fri, 23 Feb 1996 18:15:41 +0100
  6. Organization: GMD FOKUS - Research Institute for Open Communication Systems
  7. Message-ID: <312DF63D.6BD4@fokus.gmd.de>
  8. References: <4gi81k$ebb@sphinx.Gsu.EDU>
  9. NNTP-Posting-Host: pollux.fokus.gmd.de
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=iso-8859-2
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.4 sun4m)
  14.  
  15. Louis Miller Hall wrote:
  16. > #include <fstream.h>
  17. > char *name;
  18. > int  a = 1;
  19. > void main ()
  20.   ^^^^
  21. I guess, this will never end :(
  22. It's
  23.  
  24.   int main()
  25.  
  26. >   {
  27. >   while (a)
  28. >     {
  29. >     name = new char[80];
  30. >     cout << "What is the string >" << endl;
  31. >     cin.getline(name, 80);
  32. >     cout << "The string entered is >" << name << endl;
  33. >     cout << "Enter 0 to quit, any other to continue>";
  34. >     cin >> a;
  35. After entering the number, there will still be a newline character
  36. in the stream. This char will be the input of the next getline().
  37.  
  38. -- 
  39. *    Greetinx from Watson (sayegh@fokus.gmd.de)
  40.     http://www.fokus.gmd.de/ovma/employees/sayegh/entry.html
  41.     signal(SIGSEGV,SIG_IGN);
  42.